const mongoose = require('mongoose');

//数据库开启连接的方法
function dbConnect() {
    mongoose.connect('mongodb://192.168.0.103/shoponline');
    mongoose.connection.once('open',function (err) {
        if(err){
            console.log('MongoDb is not open..........');
        }else {
            console.log('MongoDb is opening......');
        }
    })
};

exports.dbConnect = dbConnect;